package com.qf.springbootproject.controller;

import com.qf.springbootproject.ResultBean.JsonResult;
import com.qf.springbootproject.pojo.Student;
import com.qf.springbootproject.pojo.User;
import com.qf.springbootproject.service.StudentService;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.stereotype.Repository;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;

@Controller
@RequestMapping("/student")
@Api(tags = "学生接口文档")
public class StudentController {

    @Resource
    private StudentService studentService;

    @PostMapping("/find")
    @ResponseBody
    public JsonResult findStudentById(String id){

        User student = studentService.findStudentById(id);
        JsonResult result = JsonResult.resultOk(student);
        return result;
    }

}
